import Service from '@/common/service/service';
import {POST_ROLE_PAGE,POST_ROLE_SAVE,POST_ROLE_DELETE,POST_ROLE_COPY} from "@/views/system/roles/roles-const";
import RequestModel from "@/common/model/request.model";
import RolesFindModel from "@/views/system/roles/model/roles-model";
import ResponseModel from "@/common/model/response.model";
import TreeNodeModel from "@/views/system/organization/model/tree-node.model";
import PagesModel from "@/components-sys/pages/pages.model";

export default class RolesService {
    /**
     * 查询全部角色
     */
    public static findRolesAll(params:RequestModel): Promise<ResponseModel<RolesFindModel[]>> {
        return Service.post(POST_ROLE_PAGE,new RequestModel(params));
    };

    /**
     * 新增或编辑角色
     */
    public static addOrEditRoles(params: RolesFindModel): Promise<ResponseModel<RolesFindModel[]>> {
        return Service.post(POST_ROLE_SAVE,params);
    };

    /**
     * 删除
     */
    public static deleteRoles(params: object[]): Promise<ResponseModel<RolesFindModel[]>> {
        return Service.post(POST_ROLE_DELETE,params);
    };

    /**
     * 复制
     */
    public static copyRoles(params: RolesFindModel): Promise<ResponseModel<RolesFindModel[]>> {
        return Service.post(POST_ROLE_COPY,params);
    };

}
